A comparator circuit compares an input voltage applied to its one input terminal with a reference voltage applied to its other input terminal and outputs a signal that depends on the comparison result.
In this comparator circuit, when a noise is mixed in the input voltage and the noise brings the input voltage to reach the reference voltage, the output will change frequently by that noise. In order to avoid such an unsatisfactory operation, the comparator is often provided with a hysteresis characteristic in its input and output characteristics, as disclosed in JP 2003-179468A or JP 2003-8408A.
FIG. 13 is an example of a comparator circuit (hysteresis comparator circuit) 1 that is provided with a hysteresis characteristic by adding resistors R1, R2 and R3 and a transistor Tr1 to the comparator Q1 having no hysteresis. In this hysteresis comparator circuit 1, in the case where the input voltage Vin is increased from 0V, equal to a reference potential GND, while the value of the input voltage Vin is lower than a reference voltage Vref that is set by dividing a constant voltage Vd with resistors R1 and R2, the output voltage Vout remains at a “Low” level (for example, 0V). During this period, the transistor Tr1 is in an OFF state; the input voltage of an inverting input terminal of the comparator Q1 is equal to the reference voltage Vref, whose value is given by Vd×R2/(R1+R2).
When the value of the input voltage Vin increases to the reference voltage Vref, the output voltage Vout will turn from the “Low” (L) level to the “High” (H) level (for example, 5V). The value of the input voltage when the output of the comparator turns from the L level to the H level with increasing input voltage in this way is designated as a H-side threshold VthH. The value of the H-side threshold VthH of the hysteresis comparator circuit 1 is Vd×R2/(R1+R2).
When the transistor Tr1 becomes an ON state, the value of the reference voltage Vref will be Vd×R2×R3/(R1×R2+R2×R3+R3×R1), assuming that an ON resistance of the transistor Tr1 is low. Conversely, in the case where the value of the input voltage Vin is decreased from a sufficiently high value, when the input voltage Vin becomes lower than the reference voltage Vref at the time of the ON state of this transistor Tr1, the output voltage Vout of the comparator Q1 will turn from the H level to the L level.
The value of the input voltage when the output of the comparator turns from the H level to the L level in the case where the input voltage Vin is decreased from a sufficiently high voltage in this way is designated as a L-side threshold VthL. The value of the L-side threshold VthL of the hysteresis comparator circuit 1 is equal to the reference voltage Vref when the transistor Tr1 described above is in the ON state and the value is smaller than the H-side threshold VthH.
From the above operations, the input-output characteristic of the hysteresis comparator circuit 1 becomes the one shown in FIG. 15. The difference [VthH−VthL] between the two input voltages at which the output turns from the H level to the L level and vice versa, respectively, is the hysteresis width.
Since the hysteresis comparator circuit 1 shown in FIG. 13 performs operations described above, the H-side threshold VthH, the L-side threshold VthL, and the hysteresis width that is a difference between the two thresholds can be set to desired values by adjusting the resistances of the resistors R1, R2 and R3, provided that the value of the constant voltage Vd is determined in advance.
The hysteresis comparator circuit 1 is a circuit used in the case where the input voltage Vin is designed to be converted to a binary signal by comparing it with the reference voltage Vref. However, there is a case where the magnitude of the input voltage Vin is designed to be determined by comparing it with two or more reference voltages Vref2, Vref3 and the like. In such a case, it is possible to perform the determination by providing a necessary number of the hysteresis comparator circuits 1 shown in FIG. 13 independently and adjusting the reference voltages of the circuits to be Vref2, Vref3 and the like.
However, as many voltage divider circuits, each including the resistors R1 and R2, as the number of circuits are needed in such a case. As a result, a load current of a constant voltage source for supplying the constant voltage Vd increases. In order to prevent it, enlarging the resistances of the resistors R1 and R2 is conceivable. However, in that case, the area of a pattern increases in implementing the circuit in an IC, and further introduces inconvenience that the accuracy of each resistance becomes worse.
As another measure, for example in the case of converting the input voltage into three values, it is also possible to create two reference voltages Vref2 and Vref3 with one voltage divider circuit including three resistors R4, R5 and R6 as shown in FIG. 14, prepare two hysteresis comparator circuits 2 and 3 that use them as reference voltages, and make determination. When such a configuration is adopted, only one voltage divider circuit can do even in the case where further more reference voltages are required; therefore, it is not necessary to increase the load current of the voltage source for supplying the constant voltage Vd.
However, in the case of the two hysteresis comparator circuits shown in this FIG. 14, when the input voltage Vin increases from 0V to exceed the reference voltage Vref2 that is the H-side threshold VthH of the hysteresis comparator circuit 2, the transistor Tr2 will turn to the ON state, and a current will flow in the resistor R7. Then, the value of the reference voltage Vref3 will change from the value determined by a voltage division ratio by the resistors R4, R5 and R6.
This indicates that, in the case where the value of the H-side threshold VthH of the hysteresis comparator circuit 3 is designed to be set to a desired value, it is insufficient to consider only the resistances of the resistors R4, R5 and R6, and the resistance of the resistor R7 used in the hysteresis comparator circuit 2 connected in parallel must be considered as well. The same applies to setting of the L-side threshold VthL of the hysteresis comparator circuit 3 and setting of the L-side threshold VthL of the hysteresis comparator circuit 2.
Thus, assuming that the resistances of resistors in other hysteresis comparator circuit connected to a common voltage divider circuit must also be considered when setting the values of the H-side threshold VthH and the L-side threshold VthL, adjustment of the resistances of voltage dividing resistors will be extremely complicated. Its complexity increases remarkably as hysteresis comparator circuits connected to the common voltage divider circuit increase in number.
Moreover, according to this method, when there occurs a need to alter a threshold voltage of any one of hysteresis comparator circuits after the resistances of the voltage dividing resistors are determined, the resistances of all the voltage dividing resistors need be adjusted again.